home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / mail / smailsr2.lha / SMail / src / RCS / convert.c,v < prev    next >
Encoding:
Text File  |  1993-11-30  |  2.0 KB  |  119 lines

  1. head    2.1;
  2. access;
  3. symbols
  4.     C_2:2.1
  5.     C_1:1.2;
  6. locks; strict;
  7. comment    @ * @;
  8.  
  9.  
  10. 2.1
  11. date    93.11.23.19.58.39;    author Aussem;    state Exp;
  12. branches;
  13. next    1.2;
  14.  
  15. 1.2
  16. date    93.09.18.16.47.47;    author Aussem;    state Exp;
  17. branches;
  18. next    1.1;
  19.  
  20. 1.1
  21. date    93.09.08.16.27.13;    author Aussem;    state Exp;
  22. branches;
  23. next    ;
  24.  
  25.  
  26. desc
  27. @converts pathalias output to smail format
  28. @
  29.  
  30.  
  31. 2.1
  32. log
  33. @Version 2.0 check in
  34. @
  35. text
  36. @/*
  37.  * convert.c
  38.  *
  39.  * This program is free software; you can redistribute it and/or
  40.  * modify it under the terms of the GNU General Public License as
  41.  * published by the Free Software Foundation; either version 2 of
  42.  * the License, or (at your option) any later version.
  43.  *
  44.  * This program is distributed in the hope that it will be useful,
  45.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  46.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  47.  * General Public License for more details.
  48.  *
  49.  * You should have received a copy of the GNU General Public License
  50.  * along with this program; if not, write to the Free Software
  51.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  52.  *
  53.  * $Log: convert.c,v $
  54.  * Revision 1.2  1993/09/18  16:47:47  Aussem
  55.  * insert GNU license text in the header
  56.  *
  57.  */
  58.  
  59.  
  60. #include <stdio.h>
  61. #include <string.h>
  62.  
  63. static char *version="$VER: convert V1.0 compiled "__DATE__;
  64.  
  65. main(argc, argv)
  66. int argc;
  67. char *argv[];
  68. {
  69.     FILE *ifp, *ofp;
  70.     char buf[1024];
  71.     register char *p,*s;
  72.    char *cost,*host,*route;
  73.  
  74.  
  75.     ifp = stdin;
  76.     ofp = stdout;
  77.  
  78.     while(fgets(buf, sizeof(buf), ifp) != NULL) {
  79.       for(s=p=buf;*p!='\t' && *p!='\0';p++);
  80.       if(p=='\0')break;
  81.       *p='\0';
  82.       cost=strdup(s);
  83.  
  84.       for(s=++p;*p!='\t' && *p!='\0';p++);
  85.       if(p=='\0')break;
  86.       *p='\0';
  87.       host=strdup(s);
  88.  
  89.       for(s=++p;*p!='\n' && *p!='\0';p++);
  90.       *p='\0';
  91.       route=strdup(s);
  92.       fprintf(ofp,"%s\t%s\t%s\n",host,route,cost);
  93.         }
  94.     return(0);
  95. }
  96. @
  97.  
  98.  
  99. 1.2
  100. log
  101. @insert GNU license text in the header
  102. @
  103. text
  104. @d18 4
  105. a21 1
  106.  * $Log$
  107. @
  108.  
  109.  
  110. 1.1
  111. log
  112. @Initial revision
  113. @
  114. text
  115. @d2 1
  116. d4 15
  117. d20 1
  118. @
  119.